package com.xizi.秋招笔试;

import java.util.Scanner;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-8-11下午 04:31
 */
public class G {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] arr = new int[7];
        int money[] = {1, 2, 5, 10, 20, 50, 100};
        for (int i = 0; i < 7; i++) {
            arr[i] = scanner.nextInt();
        }
        int sum = scanner.nextInt();
        int dp[] = new int[sum + 1];
        dp[0] = 1;
        for (int i = 0; i < 7; i++) {
            for (int j = money[i]; j <= sum; j++) {
                if (arr[i] == 0) {
                    continue;
                }
                dp[j] = (dp[j] + dp[j - money[i]]);
            }
        }
        System.out.println(dp[sum]);
    }
}
